home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
C-D
/
DeveloperStax.cpt
/
Developer Stack 1.1
/
card_11791.txt
< prev
next >
Wrap
Text File
|
1989-02-26
|
3KB
|
122 lines
-- card: 11791 from stack: in.1
-- bmap block id: 0
-- flags: 4000
-- background id: 3837
-- name: DeleteFile
-- part 1 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=82 top=302 right=324 bottom=182
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Install
----- HyperTalk script -----
on mouseUp
if the optionkey is down then pass mouseup
put installres(XFCN,DeleteFile) into it
if it is empty then play oops
else answer it
end mouseUp
-- part 2 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=224 top=241 right=292 bottom=283
-- title width / last selected line: 0
-- icon id / first selected line: 27056 / 27056
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Try It
----- HyperTalk script -----
--
--12/15/87 •••Steve Drazga•••
--
--This script needs XFCNs 'FilenName' and 'DeleteFile'
--It also uses the HyperTalk function 'OsErr'
--
on mouseUp
if the optionkey is down then pass mouseup
put "Please select a file to delete"
put filename() into deletethis
if deletethis is empty then
hide message window
play oops
exit mouseup
end if
hide message window
answer "Are you sure you want to delete this?" with "Cancel" or "OK"
if it is "Cancel" then
play oops
exit mouseup
end if
put deletefile(deletethis) into returnedthis
if returnedthis = 0 then
answer "I hope you were sure, 'cause it's gone!"
else
if returnedthis < 0 then
OsErr returnedthis
else
play oops
answer "Whoops, there was an error"
end if
end if
end mouseUp
-- part contents for background part 5
----- text -----
DeleteFile
-- part contents for background part 10
----- text -----
9
-- part contents for background part 6
----- text -----
This will delete the specified file from the disk. Be careful, there's no turning back.
Thanks to:
Dewi Williams
2227 Juniper Court
Boulder CO 80302
(303) 443 9038
Delphi: DEWI
-- part contents for background part 7
----- text -----
Syntax:
DeleteFile ("PathName")
"PathName" is the full pathname to the file you want to delete. Do not use quotation marks around it.
The result will contain either
0 (meaning a successful operation),
1 (meaning a parameter error), or
a negative number (representing an operating system error).
You can use the 'OsErr' function provided in the script of this stack to interpret operating system errors.